<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>sgp4oo: Fichero Fuente gravconsttype.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generado por Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="annotated.html"><span>Clases</span></a></li>
      <li class="current"><a href="files.html"><span>Archivos</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Lista&nbsp;de&nbsp;archivos</span></a></li>
      <li><a href="globals.html"><span>Miembros&nbsp;de&nbsp;los&nbsp;ficheros</span></a></li>
    </ul>
  </div>
<h1>gravconsttype.cpp</h1><a href="gravconsttype_8cpp.html">Ir a la documentación de este archivo.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * gravconsttype.cpp</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> *  Created on: 23/04/2012</span>
<a name="l00005"></a>00005 <span class="comment"> *      Author: ubuntu</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="gravconsttype_8h.html">gravconsttype.h</a>&quot;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="comment">/* -----------------------------------------------------------------------------</span>
<a name="l00011"></a>00011 <span class="comment">*</span>
<a name="l00012"></a>00012 <span class="comment">*                           function getgravconst</span>
<a name="l00013"></a>00013 <span class="comment">*</span>
<a name="l00014"></a>00014 <span class="comment">*  this function gets constants for the propagator. note that mu is identified to</span>
<a name="l00015"></a>00015 <span class="comment">*    facilitiate comparisons with newer models. the common useage is wgs72.</span>
<a name="l00016"></a>00016 <span class="comment">*</span>
<a name="l00017"></a>00017 <span class="comment">*  author        : david vallado                  719-573-2600   21 jul 2006</span>
<a name="l00018"></a>00018 <span class="comment">*</span>
<a name="l00019"></a>00019 <span class="comment">*  inputs        :</span>
<a name="l00020"></a>00020 <span class="comment">*    whichconst  - which set of constants to use  wgs72old, wgs72, wgs84</span>
<a name="l00021"></a>00021 <span class="comment">*</span>
<a name="l00022"></a>00022 <span class="comment">*  outputs       :</span>
<a name="l00023"></a>00023 <span class="comment">*    tumin       - minutes in one time unit</span>
<a name="l00024"></a>00024 <span class="comment">*    mu          - earth gravitational parameter</span>
<a name="l00025"></a>00025 <span class="comment">*    radiusearthkm - radius of the earth in km</span>
<a name="l00026"></a>00026 <span class="comment">*    xke         - reciprocal of tumin</span>
<a name="l00027"></a>00027 <span class="comment">*    j2, j3, j4  - un-normalized zonal harmonic values</span>
<a name="l00028"></a>00028 <span class="comment">*    j3oj2       - j3 divided by j2</span>
<a name="l00029"></a>00029 <span class="comment">*</span>
<a name="l00030"></a>00030 <span class="comment">*  locals        :</span>
<a name="l00031"></a>00031 <span class="comment">*</span>
<a name="l00032"></a>00032 <span class="comment">*  coupling      :</span>
<a name="l00033"></a>00033 <span class="comment">*    none</span>
<a name="l00034"></a>00034 <span class="comment">*</span>
<a name="l00035"></a>00035 <span class="comment">*  references    :</span>
<a name="l00036"></a>00036 <span class="comment">*    norad spacetrack report #3</span>
<a name="l00037"></a>00037 <span class="comment">*    vallado, crawford, hujsak, kelso  2006</span>
<a name="l00038"></a>00038 <span class="comment">  --------------------------------------------------------------------------- */</span>
<a name="l00051"></a>00051 <span class="keywordtype">void</span> <a class="code" href="gravconsttype_8cpp.html#ad4600d22fe78cc71f195a7c50ed92f3b" title="Esta función se utiliza para obtener el conjunto de valores dependiendo de la constante...">getgravconst</a>
<a name="l00052"></a><a class="code" href="gravconsttype_8h.html#ad4600d22fe78cc71f195a7c50ed92f3b">00052</a>      (
<a name="l00053"></a>00053       <a class="code" href="gravconsttype_8h.html#a8b910c09824c4a9d8365e717c31dda5e">gravconsttype</a> whichconst,
<a name="l00054"></a>00054       <span class="keywordtype">double</span>&amp; tumin,
<a name="l00055"></a>00055       <span class="keywordtype">double</span>&amp; mu,
<a name="l00056"></a>00056       <span class="keywordtype">double</span>&amp; radiusearthkm,
<a name="l00057"></a>00057       <span class="keywordtype">double</span>&amp; xke,
<a name="l00058"></a>00058       <span class="keywordtype">double</span>&amp; j2,
<a name="l00059"></a>00059       <span class="keywordtype">double</span>&amp; j3,
<a name="l00060"></a>00060       <span class="keywordtype">double</span>&amp; j4,
<a name="l00061"></a>00061       <span class="keywordtype">double</span>&amp; j3oj2
<a name="l00062"></a>00062      )
<a name="l00063"></a>00063      {
<a name="l00064"></a>00064 
<a name="l00065"></a>00065        <span class="keywordflow">switch</span> (whichconst)
<a name="l00066"></a>00066          {
<a name="l00067"></a>00067            <span class="comment">// -- wgs-72 low precision str#3 constants --</span>
<a name="l00068"></a>00068            <span class="keywordflow">case</span> <a class="code" href="gravconsttype_8h.html#a8b910c09824c4a9d8365e717c31dda5eae8b6ff8a0f50c5ba7f8096476f05568a">wgs72old</a>:
<a name="l00069"></a>00069            mu     = 398600.79964;        <span class="comment">// in km3 / s2</span>
<a name="l00070"></a>00070            radiusearthkm = 6378.135;     <span class="comment">// km</span>
<a name="l00071"></a>00071            xke    = 0.0743669161;
<a name="l00072"></a>00072            tumin  = 1.0 / xke;
<a name="l00073"></a>00073            j2     =   0.001082616;
<a name="l00074"></a>00074            j3     =  -0.00000253881;
<a name="l00075"></a>00075            j4     =  -0.00000165597;
<a name="l00076"></a>00076            j3oj2  =  j3 / j2;
<a name="l00077"></a>00077          <span class="keywordflow">break</span>;
<a name="l00078"></a>00078            <span class="comment">// ------------ wgs-72 constants ------------</span>
<a name="l00079"></a>00079            <span class="keywordflow">case</span> <a class="code" href="gravconsttype_8h.html#a8b910c09824c4a9d8365e717c31dda5ea5140ee8557e0d26533b36716ceb80aa1">wgs72</a>:
<a name="l00080"></a>00080            mu     = 398600.8;            <span class="comment">// in km3 / s2</span>
<a name="l00081"></a>00081            radiusearthkm = 6378.135;     <span class="comment">// km</span>
<a name="l00082"></a>00082            xke    = 60.0 / sqrt(radiusearthkm*radiusearthkm*radiusearthkm/mu);
<a name="l00083"></a>00083            tumin  = 1.0 / xke;
<a name="l00084"></a>00084            j2     =   0.001082616;
<a name="l00085"></a>00085            j3     =  -0.00000253881;
<a name="l00086"></a>00086            j4     =  -0.00000165597;
<a name="l00087"></a>00087            j3oj2  =  j3 / j2;
<a name="l00088"></a>00088          <span class="keywordflow">break</span>;
<a name="l00089"></a>00089            <span class="keywordflow">case</span> <a class="code" href="gravconsttype_8h.html#a8b910c09824c4a9d8365e717c31dda5eafa5bcd83f474e0eeb8224057e4e8837d">wgs84</a>:
<a name="l00090"></a>00090            <span class="comment">// ------------ wgs-84 constants ------------</span>
<a name="l00091"></a>00091            mu     = 398600.5;            <span class="comment">// in km3 / s2</span>
<a name="l00092"></a>00092            radiusearthkm = 6378.137;     <span class="comment">// km</span>
<a name="l00093"></a>00093            xke    = 60.0 / sqrt(radiusearthkm*radiusearthkm*radiusearthkm/mu);
<a name="l00094"></a>00094            tumin  = 1.0 / xke;
<a name="l00095"></a>00095            j2     =   0.00108262998905;
<a name="l00096"></a>00096            j3     =  -0.00000253215306;
<a name="l00097"></a>00097            j4     =  -0.00000161098761;
<a name="l00098"></a>00098            j3oj2  =  j3 / j2;
<a name="l00099"></a>00099          <span class="keywordflow">break</span>;
<a name="l00100"></a>00100          <span class="keywordflow">default</span>:
<a name="l00101"></a>00101            fprintf(stderr,<span class="stringliteral">&quot;unknown gravity option (%d)\n&quot;</span>,whichconst);
<a name="l00102"></a>00102          <span class="keywordflow">break</span>;
<a name="l00103"></a>00103          }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105      }   <span class="comment">// end getgravconst</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generado el Tue May 22 09:43:43 2012 para sgp4oo por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
